import com.xiaoshuaila.tool.*;
import org.junit.Test;

import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;

public class test {

    //是否连接数据库user
    public static void main(String[] args) {
        HttpServletRequest request=null;
    }
    //获取是否过期
    @Test
    public void test2(){
        String time="2029-10-10 10:10:10";
        Date date=new Date();
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat(
                "yyyy-MM-dd HH-mm-ss");
        System.out.println(simpleDateFormat.format(date));
        System.out.println(time.compareTo(DateTimeUtil.getSysTime()));
    }
    //获取手否失效
    @Test
    public void test3(){
        String lockstate="0";
        if ("0".equals(lockstate)) System.out.println("失效");
        else if ("0".equals(lockstate)) System.out.println("没失效");
    }
    //测试浏览器IP地址
    @Test
    public void test4(){
        String ip="192.168.3.14";
        String allowip="192.168.2.14,174.158.2.68";
        if (allowip.contains(ip))
            System.out.println("允许访问");
        else System.out.println("ip地址受限，请联系管理员");
    }
    //md5加密
    @Test
    public void test5(){
        String pwd="1135508760";
        System.out.println(MD5Util.getMD5(pwd));
    }
}
